<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <demo v-bind:msg="msg"></demo>
        
    </div>
    <script>
        Vue.component("demo",{
            //属性不可以直接修改的
            props:{
                msg:String
            },
            data:function(){
                //转换属性
                return{
                    xiaoxi:this.img
                }
            },
            template:`
            <div>
            <h1>{{xiaoxi}}</h1>
            <button @click="handleClick">修改msg</button>
            </div>
            `,
            methods:{
                handleClick:function(){
                    this.xiaoxi = "下雨了测试"
                }
            }
        })
        let vm = new Vue({
            el:"#app",
            data:{
                msg:"天气不错 西瓜"
            }
        })
    </script>
</body>
</html>